package com.baomibing.flow.constant;


import com.baomibing.flow.model.*;

public enum NodeTypeEnum {
    //任务
    Task,
    //线条
    Transit,
    //条件
    Fork,
    //重复
    Repeat,
    //并行
    Parallel,
    //聚合
    Join,
    //开始
    Start,
    //结束
    End;

    public Class<? extends WorkNode> getTypeOfClass() {
        if (this == Task) {
            return TaskNode.class;
        } else if (this == Fork) {
            return ForkNode.class;
        } else if (this == Parallel) {
            return ParallelNode.class;
        } else if (this == Join) {
            return JoinNode.class;
        } else if (this == Start) {
            return StartNode.class;
        } else if (this == End) {
            return EndNode.class;
        }
        throw new RuntimeException("can not match valid node of class!");
    }
}
